<template>
  <div class="box-demo">
    <h2>组件B</h2>
    你好{{ name }}
  </div>
</template>

<script>
export default {
    inject: ['name']
}
</script>

<style scoped>
h2{
    color:brown;
}
.box-demo{
    border: 1px solid #f00;
    background: #ff000040;
}
</style>